<?php

if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
include DISCUZ_ROOT . './source/plugin/qu_app/ainuo.php';
loadcache('plugin');
$langvars = lang('plugin/qu_app');
if (!submitcheck('submit')) {
    $colorarr = array();
    $colorarray = DB::query('SELECT * from ' . DB::table('qu_appnew') . '');
    DB::fetch($colorarray);
    foreach (DB::fetch($colorarray) as $key => $colorarrnew) {
        $colorarr[$key] = $colorarrnew;
    }
    showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=qu_app&pmod=color', 'submit');
    showtableheader(lang('plugin/qu_app', 'setting'));
    echo '<input type="hidden" name="formhash" value="' . FORMHASH . '">';
    showsetting(lang('plugin/qu_app', 'topbgcolor'), 'color_atopbg', $colorarr['color_atopbg'], 'color');
    showsetting(lang('plugin/qu_app', 'topwordcolor'), 'color_atopword', $colorarr['color_atopword'], 'color');
    showsetting(lang('plugin/qu_app', 'toplinecolor'), 'color_atopline', $colorarr['color_atopline'], 'color');
    showsetting(lang('plugin/qu_app', 'bottomcolor'), 'color_wordbottom', $colorarr['color_wordbottom'], 'color');
    showsetting(lang('plugin/qu_app', 'linkcolor'), 'color_link', $colorarr['color_link'], 'color');
    showsubmit('submit');
    showtablefooter();
    showformfooter();
} else {
    $newdata = array('color_atopbg' => $_GET['color_atopbg'], 'color_atopword' => $_GET['color_atopword'], 'color_atopline' => $_GET['color_atopline'], 'color_wordbottom' => $_GET['color_wordbottom'], 'color_link' => $_GET['color_link']);
    DB::update('qu_appnew', $newdata);
    include_once DISCUZ_ROOT . './template/qu_app/touch/ainuo/config.php';
    error_reporting(0);
    cpmsg('plugins_setting_succeed', 'action=plugins&operation=config&do=' . $pluginid . '&identifier=qu_app&pmod=color', 'succeed');
}
echo '
';